<div class="header_menu">
    <div class="container">
        <div class="header-nav clearfix">
            <?php echo $this->partial('shop/layout/headerMenu'); ?>
        </div>
    </div>
</div>
</div>
<div class="container breadcrumbs">
    <a href="<?php echo $this->url('shop'); ?>"><?php echo $this->translate('首页'); ?></a>
    <span class="sep">/</span><span><?php echo $this->translate('账户余额'); ?></span>
</div>
<div class="container">
    <div class="uc-full-box">
        <div class="row">
            <div class="span4">
                <?php echo $this->partial('shop/partial/home/leftMenu'); ?>
            </div>
            <div class="span16">
                <div class="xm-line-box uc-box">
                    <h3 class="right-more-title">
                        <?php echo $this->translate('账户余额'); ?> [<font color="#dd4b39"><?php echo $this->shopCurrencyFormat($this->userInfo->getUserMoney()); if(!$this->sameCurrency) echo ' ('.$this->frontCurrency($this->userInfo->getUserMoney()).')'; ?></font>]
                    </h3>
                    <div class="box-hd-more">
                        <div class="span16">
                            <div class="span12 pull-left left-menu-more">
                                <div class="uc-order-list-type">
                                    <a href="javascript:;" class="current"><?php echo $this->translate('账户余额记录'); ?></a>
                                </div>
                            </div>
                            <div class="span4 pull-right">
                                <?php if ($this->shopHelper()->customer('recharge_state', 'customer') == 1) { ?>
                                    <a href="<?php echo $this->url('home-user-balance', ['action' => 'recharge']); ?>" class="btn btn-primary btn-small btn-a-url"><?php echo $this->translate('现金充值'); ?></a>
                                <?php } ?>
                                <a href="<?php echo $this->url('home-user-balance', ['action' => 'rechargeCode']); ?>" class="btn btn-primary btn-small pull-right btn-a-url"><?php echo $this->translate('充值码充值'); ?></a>
                            </div>
                        </div>
                    </div>
                    <div class="box-bd">
                        <?php
                        if ($this->userBalanceLog->getCurrentItemCount() > 0){ ?>
                            <table class="table table-bordered table-hover" style="margin-top: 15px;">
                                <thead>
                                <tr>
                                    <th style="width: 22%"><?php echo $this->translate('时间'); ?></th>
                                    <th style="width: 12%"><?php echo $this->translate('操作金额'); ?></th>
                                    <th style="width: 12%"><?php echo $this->translate('余额'); ?></th>
                                    <th style="width: 10%"><?php echo $this->translate('类型'); ?></th>
                                    <th style="width: 12%"><?php echo $this->translate('操作者'); ?></th>
                                    <th style="width: 32%"><?php echo $this->translate('备注'); ?></th>
                                </tr>
                                </thead>
                                <?php foreach ($this->userBalanceLog as $logValue) { ?>
                                    <tr>
                                        <td><?php echo $this->shopDateFormat()->shopBalanceLogTime($logValue->getBalanceChangeTime()); ?></td>
                                        <td><?php echo $this->shopCurrencyFormat($logValue->getBalanceChangeNum()); ?></td>
                                        <td><?php echo $this->shopCurrencyFormat($logValue->getBalanceChangedAmount()); ?></td>
                                        <td><?php echo $this->userHelper()->userChangeBalanceType($logValue->getBalanceChangeType()); ?></td>
                                        <td>
                                            <?php
                                            if($logValue->getAdminId() != 0) echo $this->translate('管理员');
                                            else echo $this->escapeHtml($logValue->getUserName());
                                            ?></td>
                                        <td><?php echo $this->escapeHtml($logValue->getBalanceChangeInfo()); ?></td>
                                    </tr>
                                <?php } ?>
                            </table>
                            <div>
                                <?php echo $this->paginationControl($this->userBalanceLog, 'Sliding', 'shop/page', ['route' => 'home-user-balance']); ?>
                            </div>
                        <?php } else { ?>
                            <?php echo $this->translate('暂无记录!'); ?>
                        <?php } ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>